#include<stdio.h>

int main(int argc, char const *argv[])
{
    int n,k=1;
    scanf("%d",&n);
    while (1)
    {
        for (int x = 100; x >0 ; x--)
        {
            if (364*(x+3*k)==n)
            {
                printf("%d\n%d",x,k);
                return 0;
            }
            
        }
        
        k++;
    }
    
    return 0;
}
